﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TLDNs.Views;
using Prism.Commands;
using Prism.Events;
using Prism.Ioc;
using Prism.Mvvm;
using Prism.Regions;
using ECANPort;

namespace TLDNs.ViewModels
{
    public class ParameterEditTreeViewModel : CanDevViewModelBase
    {
        public ParameterEditTreeViewModel(IContainerExtension Container, IRegionManager rm , IEventAggregator ea) :base(Container,rm,ea)
        {
            //CanDev.ECAN_RecvDataEvent += CanDev_ECAN_RecvDataEvent;
        }

        public string _Can1RecvData;
        public string Can1RecvData
        {
            get { return _Can1RecvData; }
            set { SetProperty(ref _Can1RecvData, value); }
        }
        private string _Can2RecvData;
        public string Can2RecvData
        {
            get { return _Can2RecvData; }
            set { SetProperty(ref _Can2RecvData, value); }
        }


        private void CanDev_ECAN_RecvDataEvent(CAN_OBJ frameinfo, uint CanIndex)
        {
            string str  = frameinfo.ToString();
            if (CanIndex == 0)
            {
                Can1RecvData = str;
            }
            if (CanIndex == 1)
            {
                Can2RecvData = str;
            }
        }

     

        protected override void SFMFileIsReLoaded()
        {
            
        }

        

    }
}
